package com.duolaibei.pay.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.duolaibei.pay.R;
import com.duolaibei.pay.base.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by wangshuo on 2017/5/13.
 */

public class CollectMoneyActivity extends BaseActivity {

    @Bind(R.id.brush_layout)
    LinearLayout brushLayout;//刷卡

    @Bind(R.id.sweep_layout)
    LinearLayout sweepLayout;//扫码

    @Bind(R.id.brushmg_layout)
    LinearLayout brushmgLayout;//刷卡管理

    @Bind(R.id.sweepmg_layout)
    LinearLayout sweepmgLayout;//扫码管理

    @Bind(R.id.detail_layout)
    LinearLayout detailLayout;//交易明细

    public final static int INDEX_BRUSH = 1;//刷卡
    public final static int INDEX_SWEEEP = 2;//扫码

    @Override
    public int getContentViewResId() {
        return R.layout.activity_collect_money;
    }

    @Override
    public void intiViews() {
        brushLayout.setOnClickListener(this);
        sweepLayout.setOnClickListener(this);
        brushmgLayout.setOnClickListener(this);
        sweepmgLayout.setOnClickListener(this);
        detailLayout.setOnClickListener(this);
    }

    @Override
    public String setTitle() {
        return getString(R.string.collect_money);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
    }

    @Override
    public void onClick(View view) {
        Intent intent = null;
        super.onClick(view);
        int id = view.getId();
        switch (id) {
            case R.id.brush_layout://刷卡
                intent = new Intent(this, BrushCard2Activity.class);
                intent.putExtra("type", -1);
                intent.putExtra("value", INDEX_BRUSH);
                break;
            case R.id.sweep_layout://扫码
                intent = new Intent(this, BrushCardActivity.class);
                intent.putExtra("value", INDEX_SWEEEP);
                break;
            case R.id.brushmg_layout:
                intent = new Intent(this, BrushCardManagerActivity.class);
                break;
            case R.id.sweepmg_layout:
                intent = new Intent(this, SweepManageActivity.class);
                break;
            case R.id.detail_layout://交易明细
                intent = new Intent(this, TransactionActivity.class);
                break;
        }
        if (null != intent) {
            startActivity(intent);
        }
    }
}
